package com.shuaidong.site.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.shuaidong.site.entity.SysLog;
import com.shuaidong.site.mapper.SysLogMapper;
import com.shuaidong.site.service.ISysLogService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import java.util.Date;

/**
 * @author td
 * @date 2017/12/21
 */
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper,SysLog> implements ISysLogService{

    public static final Logger logger = Logger.getLogger(SysLogServiceImpl.class);

    @Override
    public void insertLog(String title, String uname, String url, String parms) {
        SysLog sysLog = new SysLog();
        sysLog.setCreateTime(new Date());
        sysLog.setTitle(title);
        sysLog.setUserName(uname);
        sysLog.setUrl(url);
        sysLog.setParams(parms);
        super.insert(sysLog);
        logger.debug("记录日志:"+sysLog.toString());
    }
}
